home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _81fa779a35004513d649b7c7e1787b96 < prev    next >
Encoding:
Text File  |  2002-05-31  |  8.2 KB  |  209 lines

  1. package ActivePerl::DocTools::TOC::HTML;
  2. our $VERSION = '0.10';
  3.  
  4. use strict;
  5. use warnings;
  6. use base ('ActivePerl::DocTools::TOC');
  7.  
  8.  
  9. my $indent = ' ' x 4;
  10.  
  11. # constructs the simpler methods
  12. sub text {
  13.     my ($text) =  join '', map { "$_\n" } @_;
  14.     return sub { $text };
  15. }
  16.  
  17.  
  18. # extra info is tedious to collect -- is done in a subclass or something.
  19. sub extra { '' };
  20.  
  21.  
  22. *header = text ("<hr><p>","<h4>Perl Core Documentation</h4>",);
  23.  
  24. sub before_pods { '' }
  25.  
  26. *pod_separator = text('<br>');
  27.  
  28. sub pod {
  29.     my ($self, $file) = @_;
  30.     return _page($self->{'podz'}->{"Pod::$file"}, $file, $self->extra($file));
  31. }
  32.  
  33. sub after_pods { '' }
  34.  
  35. *before_scripts = text("<hr><p>","<h4>Programs</h4>",);
  36.  
  37. sub script {
  38.     my ($self, $file) = @_;
  39.     return _page($self->{'scriptz'}->{$file}, $file, $self->extra($file));
  40. }
  41.  
  42. sub after_scripts { '' }
  43.  
  44.  
  45. *before_pragmas = text("<hr><p>","<h4>Pragmas</h4>",);
  46.  
  47. sub pragma {
  48.     my ($self, $file) = @_;
  49.     return _page($self->{'pragmaz'}->{$file}, $file, $self->extra($file));
  50. }
  51.  
  52. sub after_pragmas { '' }
  53.  
  54.  
  55. *before_libraries = text("<hr><p>","<h4>Modules</h4>",);
  56.  
  57. *library_indent_open = sub {''};  # text('<ul compact>');
  58. *library_indent_close = sub {''}; # text('</ul>');
  59. *library_indent_same = sub {''};
  60.  
  61. sub library {
  62.     my ($self, $file, $showfile, $depth) = @_;
  63.     return (($indent x $depth) . _page($self->{'filez'}->{$file}, $showfile, $self->extra($file)));
  64. }
  65.  
  66. sub library_container {
  67.     my ($self, $file, $showfile, $depth) = @_;
  68.     return (($indent x $depth) . _folder($showfile));
  69. }
  70.  
  71. sub after_libraries { '' }
  72.  
  73. *footer = text("</div></body></html>");
  74.  
  75.  
  76. sub _folder {
  77.     my ($text) = @_;
  78.     defined $text or die "no argument to _folder!";
  79.     return qq'<img src="images/greysmallbullet.gif" width="5" height="5" alt="*"> $text<br>\n';
  80. }
  81.  
  82. sub _page {
  83.     my ($href, $text, $extra) = @_;
  84.     die "bad arguments to _page: ($href, $text, $extra)" unless (defined $href and defined $text);
  85.     defined $extra or $extra = '';
  86.     if ($extra ne '') {
  87.         $extra = " $extra";  # just to make it EXACTLY identical to the old way. 
  88.     }
  89.     return qq'<img src="images/greysmallbullet.gif" width="5" height="5" alt="*"> <a class="doc" href="$href">$text</a>$extra<br>\n';
  90. }
  91.  
  92.  
  93. sub boilerplate {
  94.     # warn "boilerplate";
  95.     return boiler_header() . boiler_links();
  96. }
  97.     
  98. sub boiler_header {
  99.     # warn "boiler_header";
  100.     return (<<HERE);
  101. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  102. <html>
  103.  
  104. <head>
  105. <title>ActivePerl User Guide - Table of Contents</title>
  106. <base target="PerlDoc">
  107. <link rel="STYLESHEET" href="Active.css" type="text/css">
  108. </head>
  109.  
  110. <body>
  111.  
  112. <h1>Table of Contents</h1>
  113.  
  114. HERE
  115.  
  116. }
  117.  
  118.  
  119. sub boiler_links {
  120.     # warn "boiler_links";
  121.     return (<<HERE);
  122. <div nowrap>
  123.  
  124. <p><strong>Getting Started</strong><br>
  125.  
  126.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  127. <a class="doc" href="perlmain.html">Welcome To ActivePerl</a><br>
  128.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  129. <a class="doc" href="RELEASE.html">Release Notes</a><br>
  130.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  131. <a class="doc" href="install.html">Installation Guide</a><br>
  132.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  133. <a class="doc" href="readme.html">Getting Started</a><br>
  134.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  135. <a class="doc" href="CHANGES.html">ActivePerl Change Log</a><br>
  136.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  137. <a class="doc" href="resources.html">More Resources</a><br>
  138.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  139. <a class="doc" href="Copyright.html">License and Copyright</a><br>
  140.  
  141.  
  142. <strong>ActivePerl Components</strong><br>
  143.  
  144.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  145. <a class="doc" href="Components/Descriptions.html">Overview</a><br>
  146.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  147. <a class="doc" href="faq/ActivePerl-faq2.html">PPM</a><br>
  148.  
  149.     <strong>Windows Specific</strong><br>
  150.  
  151.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  152. <a class="doc" href="OLE-Browser/Browser.html" target="_blank">OLE Browser</a><br>
  153.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  154. <a class="doc" href="Components/Windows/PerlScript.html">PerlScript</a><br>
  155.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  156. <a class="doc" href="../eg/IEExamples/index.htm">PerlScript Examples</a><br>
  157.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  158. <a class="doc" href="Components/Windows/PerlISAPI.html">Perl for ISAPI</a><br>
  159.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  160. <a class="doc" href="Components/Windows/PerlEz.html">PerlEz</a><br>
  161.  
  162. <strong>ActivePerl FAQ</strong><br>
  163.  
  164.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  165. <a class="doc" href="faq/ActivePerl-faq.html">Introduction</a><br>
  166.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  167. <a class="doc" href="faq/ActivePerl-faq1.html">Availability & Install</a><br>
  168.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  169. <a class="doc" href="faq/ActivePerl-faq2.html">Using PPM</a><br>
  170.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  171. <a class="doc" href="faq/ActivePerl-faq3.html">Docs & Support</a><br>
  172.  
  173.  
  174.     <strong>Windows Specific</strong><br>
  175.  
  176.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  177. <a class="doc" href="faq/Windows/ActivePerl-Winfaq2.html">Perl for ISAPI</a><br>
  178.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  179. <a class="doc" href="faq/Windows/ActivePerl-Winfaq4.html">Windows 9X/NT/2000</a><br>
  180.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  181. <a class="doc" href="faq/Windows/ActivePerl-Winfaq5.html">Windows Quirks</a><br>
  182.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  183. <a class="doc" href="faq/Windows/ActivePerl-Winfaq6.html">Web Server Config</a><br>
  184.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  185. <a class="doc" href="faq/Windows/ActivePerl-Winfaq7.html">Web Programming</a><br>
  186.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  187. <a class="doc" href="faq/Windows/ActivePerl-Winfaq8.html">Windows Programming</a><br>
  188.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  189. <a class="doc" href="faq/Windows/ActivePerl-Winfaq9.html">Modules & Samples</a><br>
  190.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  191. <a class="doc" href="faq/Windows/ActivePerl-Winfaq10.html">Embedding & Extending</a><br>
  192.        <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  193. <a class="doc" href="faq/Windows/ActivePerl-Winfaq12.html">Using OLE with Perl</a><br>
  194.  
  195. <strong>Windows Scripting</strong><br>
  196.  
  197.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  198. <a class="doc" href="Windows/ActiveServerPages.html">Active Server Pages</a><br>
  199.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  200. <a class="doc" href="Windows/WindowsScriptHost.html">Windows Script Host</a><br>
  201.     <img src="images/greysmallbullet.gif" width="5" height="5" alt="*">
  202. <a class="doc" href="Windows/WindowsScriptComponents.html">Windows Script Components</a></p>
  203.  
  204.  
  205. HERE
  206. }
  207.  
  208.  
  209.